snprintf (d, n, "\tpixels=%li", fish->fish.pixels);
n -= strlen (d);d += strlen (d);
- snprintf (d, n, " processings=%i", fish->fish.processings);
- n -= strlen (d);d += strlen (d);
-
snprintf (d, n, " cost=%d", (int)fish->fish_path.cost);
n -= strlen (d);d += strlen (d);
{
const Babl **fa = (void*)a;
const Babl **fb = (void*)b;
- return ((*fb)->fish.pixels - (*fa)->fish.pixels) +
- ((*fb)->fish.processings - (*fa)->fish.processings);
+ return ((*fb)->fish.pixels - (*fa)->fish.pixels);
}
static const char *cache_header (void)
case '-': /* finalize */
if (babl)
{
- if (((babl->fish.pixels + babl->fish.processings) % 100) == (tim % 100))
+ if ((babl->fish.pixels) == (tim % 100))
{
/* 1% chance of individual cached conversions being dropped -
* making sure mis-measured conversions do not
{
babl->fish.pixels = strtol (token2 + 7, NULL, 10);
}
- else if (!strncmp (token2, "processings=", 12))
- {
- babl->fish.processings = strtol (token2 + 12, NULL, 10);
- }
token2 = strtok_r (NULL, seps2, &tokp2);
}
}
babl->conversion.cost = 69L;
babl->conversion.pixels = 0;
- babl->conversion.processings = 0;
babl->conversion.data = user_data;
ref_destination_rgba_double,
test_pixels * 4);
- fish_rgba_to_source->fish.processings--;
- fish_reference->fish.processings--;
- fish_destination_to_rgba->fish.processings -= 2;
-
fish_rgba_to_source->fish.pixels -= test_pixels;
fish_reference->fish.pixels -= test_pixels;
fish_destination_to_rgba->fish.pixels -= 2 * test_pixels;
BablFuncPlane plane;
BablFuncPlanar planar;
} function;
- int processings;
long pixels;
};
strcpy (babl->instance.name, name);
babl->fish.source = source;
babl->fish.destination = destination;
- babl->fish.processings = 0;
babl->fish.pixels = 0;
babl->fish.error = BABL_MAX_COST_VALUE;
babl->fish_path.cost = BABL_MAX_COST_VALUE;
long n)
{
Babl *babl = (void*)cbabl;
- babl->fish.processings++;
babl->fish.pixels += n;
babl->fish.dispatch (babl, source, destination, n, *babl->fish.data);
return n;
if (n <= 0)
return 0;
- babl->fish.processings++;
babl->fish.pixels += n * rows;
for (row = 0; row < rows; row++)
{
babl->fish.source = source;
babl->fish.destination = destination;
- babl->fish.processings = 0;
babl->fish.pixels = 0;
babl->fish.error = 0.0; /* assuming the provided reference conversions for types
and models are as exact as possible
babl->fish.source = conversion->source;
babl->fish.destination = conversion->destination;
- babl->fish.processings = 0;
babl->fish.pixels = 0;
babl->fish_simple.conversion = conversion;
babl->fish.error = 0.0;/* babl fish simple should only be used by bablfish
const Babl *destination;
void (*dispatch) (const Babl *babl, const char *src, char *dst, long n, void *data);
void **data; /* user data - only used for conversion redirect */
+ long pixels; /* number of pixels translates */
double error; /* the amount of noise introduced by the fish */
-
/* instrumentation */
- int processings; /* number of times the fish has been used */
- long pixels; /* number of pixels translates */
- long usecs; /* usecs spent within this fish */
} BablFish;
/* BablFishSimple is the simplest type of fish, wrapping a single
* conversion function, (note this might not be the optimal chosen
- * conversion even if it exists)
- *
- * TODO: exterminate
+ * conversion even if it exists), these fishes are used internally for
+ * instance in reference fishes.
*/
typedef struct
{
loss = babl_rel_avg_error (clipped, test, test_pixels * 4);
- fish_to->fish.processings -= 2;
- fish_from->fish.processings -= 2;
fish_to->fish.pixels -= test_pixels * 2;
fish_from->fish.pixels -= test_pixels * 2;
long n)
{
BablConversion *conversion = (BablConversion *) babl;
- conversion->processings++;
conversion->pixels += n;
conversion->dispatch (babl, source, destination, n, conversion->data);
}
static void
conversion_introspect (Babl *babl)
{
- babl_log ("\t\tprocessings:%i pixels:%li",
- babl->conversion.processings, babl->conversion.pixels);
+ babl_log ("\t\tpixels:%li", babl->conversion.pixels);
if (BABL (babl->conversion.source)->class_type == BABL_FORMAT)
{
babl_log ("\t\terror: %f", babl_conversion_error (&babl->conversion));
static void
fish_introspect (Babl *babl)
{
- babl_log ("\t\tprocessings:%i pixels:%li",
- babl->fish.processings, babl->fish.pixels);
+ babl_log ("\t\tpixels:%li", babl->fish.pixels);
}
static void
babl_process (fish_to, clipped, destination, test_pixels);
babl_process (fish_from, destination, transformed, test_pixels);
- fish_to->fish.processings -= 2;
- fish_from->fish.processings -= 2;
fish_to->fish.pixels -= test_pixels * 2;
fish_from->fish.pixels -= test_pixels * 2;
babl_process (fish_to, clipped, destination, samples);
babl_process (fish_from, destination, transformed, samples);
- fish_from->fish.processings -= 2;
- fish_to->fish.processings -= 2;
fish_from->fish.pixels -= samples * 2;
fish_to->fish.pixels -= samples * 2;